package com.hsq.spzx.manager.controller;


import com.hsq.spzx.manager.service.FileUploadService;
import com.hsq.spzx.model.vo.common.Result;
import com.hsq.spzx.model.vo.common.ResultCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author hsq
 * @date 2025-06-03 下午3:21
 */
@RestController
@RequestMapping("/admin/system")
public class FileUploadController {

    @Autowired
    private FileUploadService fileUploadService;

    @PostMapping(value = "/fileUpload")
    public Result<String> fileUploadService(@RequestParam(name = "file")MultipartFile file) {
        String fileUrl = fileUploadService.fileUpload(file) ;
        return Result.build(fileUrl , ResultCodeEnum.SUCCESS) ;
    }
}
